package mcsm.OperationCenter;

import mcsm.DataBaseIntegration.DataBaseConnect;
import mcsm.DataBaseIntegration.EditGoodsConnect;
import mcsm.DataBaseInterface.Connector;
import mcsm.Model.Goods;

public class EditGoods {
	private DataBaseConnect database;
	private Connector connector;
	
	public EditGoods(){
		database=DataBaseConnect.getDatabase();
	}
	public Goods editGoods(Goods tempGoods, String name,
			double cost, double price, int quantity, String description,
			double ticketValue, double bargain) {

		tempGoods.setName(name);
		tempGoods.setCost(cost);
		tempGoods.setPrice(price);
		tempGoods.setQuantity(quantity);
		tempGoods.setDescription(description);
		tempGoods.setTicketValue(ticketValue);
		tempGoods.setBargain(bargain);

		connector=new EditGoodsConnect(tempGoods);
		database.connect(connector);
		return tempGoods;
	}
}
